#!/bin/bash

echo 启动患者管理系统WebSocket服务器...echo

# 检查Python是否安装
if ! command -v python3 &> /dev/null; then
    echo 错误: 未找到Python3，请先安装Python30.7+
    exit 1
fi

# 检查websockets库是否安装
if ! python3 -c import websockets" &> /dev/null; then
    echo "正在安装websockets库... pip3 install websockets
    if  $? -ne0 then
        echo 错误: 安装websockets库失败"
        exit1
    fi
fi

echo "WebSocket服务器启动中..."
echo "服务器地址: ws://localhost:8080
echo按Ctrl+C 停止服务器"
echo

python3ebsocket_server.py 